<template>
	<view>
		<view class="address">
			<view class="item">
				<view class="title">发布者信息：</view>
				<view class="top">{{addFrom.name}} {{addFrom.phone}}</view>
				<view class="bot">{{addFrom.province}}{{addFrom.city}}{{addFrom.district}}{{addFrom.address}}</view>
			</view>
			<view class="item">
				<view class="title">响应者信息：</view>
				<view class="top">{{addTo.name}} {{addTo.phone}}</view>
				<view class="bot">{{addTo.province}}{{addTo.city}}{{addTo.district}}{{addTo.address}}</view>
			</view>
		</view>
		<view class="content">
			<view class="book">
				<image :src="detail.goods.picture"></image>
				<view class="right">
					<span class="bookTitle">
						{{detail.goods.title}}
					</span>
					<span class="author">
						新旧程度: {{detail.goods.author}}
					</span>
					<span class="message">
						{{detail.goods.goodsDesc}}
					</span>
				</view>
				<view class="tag">
					<u-tag text="收" plain size="mini" type="warning" v-if="detail.goods.isDonation==0"></u-tag>
					<u-tag text="捐" plain size="mini" type="success" v-else></u-tag>
				</view>
			</view>
			<view class="bottom">
				<view class="item">创建时间：{{detail.gmtCreate}}</view>
				<view class="item">订单编号：{{detail.orderId}}</view>
				<view class="item" v-if="detail.expressId">物流单号：{{detail.expressId}}</view>
				<view class="item" v-else>物流单号：等待上传</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				detail: {},
				addFrom: {}, //发布者信息
				addTo: {} //接手者信息
			}
		},
		onLoad(options) {
			var detail = JSON.parse(decodeURIComponent(options.info))
			console.log(detail);
			this.detail = detail
			this.addFrom = detail.addIdFrom
			this.addTo = detail.addIdTo
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.address {
		margin: 20rpx;
		background-color: white;
		border-radius: 20rpx;
		padding: 40rpx;

		.item {
			margin-bottom: 20rpx;

			.title {
				font-weight: bold;
				margin-bottom: 10rpx;
			}

			.top {
				display: flex;
				justify-content: space-between;
				color: #666666;
			}

			.bot {
				font-size: smaller;
				color: lightgray;
			}
		}
	}

	.content {
		background-color: #fff;
		border-radius: 20rpx;
		margin: 20rpx;
		padding-bottom: 20rpx;

		.book {
			display: flex;
			border-bottom: 1rpx solid #f5f5f5;
			padding-bottom: 10rpx;
			margin: 20rpx;

			image {
				width: 160rpx;
				height: 200rpx;
				margin: 20rpx 20rpx;
			}

			.right {
				margin-left: 20rpx;
				width: 65%;

				.bookTitle {
					display: block;
					color: #d81e06;
					margin-top: 20rpx;
					font-size: 28rpx;
					font-weight: bold;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}

				.author {
					display: block;
					font-size: 24rpx;
					color: gray;
					margin-top: 20rpx;
				}

				.message {
					font-size: 24rpx;
					margin-top: 20rpx;
					overflow: hidden;
					display: -webkit-box;
					-webkit-line-clamp: 2;
					-webkit-box-orient: vertical;
					text-overflow: ellipsis;
				}
			}

			.tag {
				margin-right: 20rpx;
				margin-top: 190rpx;
			}
		}

		.bottom {
			.item {
				margin: 20rpx;
				font-size: 24rpx;
			}
		}
	}
</style>
